/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utilitarios;

import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Random;

/**
 *
 * @author WALTER
 */
public class CreaData {
     public void crearPedido(){
        FileWriter fichero = null;
        PrintWriter pw = null;
        String val="0";
        try
        {
            fichero = new FileWriter("Pedidos.txt");
            
            for (int i = 0; i < 40; i++){
                
                Random ramdonGenerator = new Random();
                int randomInt1 = ramdonGenerator.nextInt(300);
                randomInt1 +=1500;
                Random ramdonGenerator2 = new Random();
                int randomInt2 = ramdonGenerator2.nextInt(300);
                randomInt2 +=1500;
                int randomInt3 = ramdonGenerator.nextInt(300);
                randomInt3 +=1500;
                pw = new PrintWriter(fichero);
                pw.println(randomInt1+" "+randomInt2+" "+randomInt3);
              //  pw.println(randomInt1+" "+randomInt2);
            }
            
 
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
           try {
           // Nuevamente aprovechamos el finally para
           // asegurarnos que se cierra el fichero.
           if (null != fichero)
              fichero.close();
           } catch (Exception e2) {
              e2.printStackTrace();
           }
        }    
    }
    public  void crearEmp(String[] args) {
        
        FileWriter fichero = null;
        PrintWriter pw = null;
        String val="0";
        try
        {
            //System.out.println("ENTRE AQUI");
            for (int i = 0; i < 40; i++){
                fichero = new FileWriter("Empleados"+i+".txt");
                
                for (int j =0; j< 60; j++){
                    Random ramdonGenerator = new Random();
                 //   System.out.println("ENTRE AQUI");
                    int randomInt1 = ramdonGenerator.nextInt(100);
                    randomInt1 +=300;
                    int randomInt2 = ramdonGenerator.nextInt(100);
                    randomInt2 +=300;
                    int randomInt3 = ramdonGenerator.nextInt(100);
                    randomInt3 +=300;
                    int randomInt4 = ramdonGenerator.nextInt(100);
                    randomInt4 +=300;
                
                    int r1 = ramdonGenerator.nextInt(15);                
                    int r2 = ramdonGenerator.nextInt(15);                
                    int r3 = ramdonGenerator.nextInt(15);                
                    int r4 = ramdonGenerator.nextInt(15);
                
                
                    pw = new PrintWriter(fichero);
                    pw.println(randomInt1+" "+randomInt2+" "+randomInt3+" "+randomInt4+"/"+r1+" "+r2+" "+r3+" "+r4);
                
                 }
                try {
                // Nuevamente aprovechamos el finally para
                 // asegurarnos que se cierra el fichero.
                if (null != fichero)
                    fichero.close();
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }
            
 
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
           
        }    
        
    }
    
}
